package cn.cxy.myapplication

import android.os.Bundle
import android.view.View
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import cn.cxy.myapplication.annotation.BindView
import cn.cxy.myapplication.annotation.ContentView
import cn.cxy.myapplication.annotation.Injection
import cn.cxy.myapplication.annotation.OnClick

@ContentView(value = R.layout.activity_main)
class MainActivity : AppCompatActivity() {
    @BindView(value = R.id.button1)
    var button1: Button? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Injection.inject(this)
    }

    @OnClick(value = R.id.button1)
    fun button1Click(view: View?) {
        Toast.makeText(this@MainActivity, "button1 clicked", Toast.LENGTH_LONG).show()
    }
}